home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GNUGEM27 / VDICTRL1.C < prev    next >
C/C++ Source or Header  |  1993-03-24  |  3KB  |  134 lines

  1. /*
  2.  *    Vdi contrl functions library interface (part 1)
  3.  *
  4.  *    v_opnwk     open workstation
  5.  *    v_clswk     close workstation
  6.  *    v_opnvwk    open virtual
  7.  *    v_clsvwk    close virtual
  8.  *
  9.  *        ++jrb    bammi@cadence.com
  10.  *        modified: mj -- ntomczak@vm.ucs.ualberta.ca
  11.  */
  12. #include "common.h"
  13.  
  14. #ifdef __DEF_ALL__
  15.  
  16. #define L_v_opnwk
  17. #define L_v_clswk
  18. #define L_v_opnvwk
  19. #define L_v_clsvwk
  20.  
  21. #endif /* __DEF_ALL__ */
  22.  
  23.  
  24. #ifdef L_v_opnwk
  25.  
  26. /* open workstation -- kinda redundant
  27.  *    returns void
  28.  */
  29. void v_opnwk(int work_in[], int *handle, int work_out[])
  30. {
  31. #ifndef __MSHORT__
  32.     short *iptr;
  33.     int   *wptr, *end;
  34.  
  35.     iptr = _intin;
  36.     end = &work_in[11];
  37.     do {
  38.     *iptr++ = *work_in++;
  39.     } while (work_in < end);
  40.  
  41.     __vdi__(VDI_CONTRL_ENCODE(1, 0, 11, 0), 0);
  42.  
  43.     wptr = work_out;
  44.     end = wptr + 45;
  45.     iptr = _intout;
  46.     do {
  47.     *wptr++ = *iptr++;
  48.     } while (wptr < end);
  49.     end += 12;
  50.     iptr = _ptsout;
  51.     do {
  52.     *wptr++ = *iptr++;
  53.     } while (wptr < end);
  54. #else
  55.     _vdiparams[1] = &work_in[0];
  56.     _vdiparams[3] = &work_out[0];
  57.     _vdiparams[4] = &work_out[45];
  58.     __vdi__(VDI_CONTRL_ENCODE(1, 0, 11, 0), 0);
  59.     _vdiparams[1] = (void *)&_intin[0];
  60.     _vdiparams[3] = (void *)&_intout[0];
  61.     _vdiparams[4] = (void *)&_ptsout[0];
  62. #endif
  63.     *handle = _contrl[6];
  64.  
  65. }
  66. #endif /* L_v_opnwk */
  67.  
  68. #ifdef L_v_clswk
  69.  
  70. /* close workstation
  71.  *    returns void
  72.  */
  73. void v_clswk(int handle)
  74. {
  75.     __vdi__(VDI_CONTRL_ENCODE(2, 0, 0, 0), handle);
  76. }
  77. #endif /* L_v_clswk */
  78.  
  79. #ifdef L_v_opnvwk
  80.  
  81. /* open virtual workstation
  82.  *    returns void
  83.  */
  84. void v_opnvwk(int work_in[], int *handle, int work_out[])
  85. {
  86. #ifndef __MSHORT__
  87.     short *iptr;
  88.     int   *wptr, *end;
  89.  
  90.     iptr = _intin;
  91.     end = &work_in[11];
  92.     do {
  93.     *iptr++ = *work_in++;
  94.     } while (work_in < end);
  95.  
  96.     __vdi__(VDI_CONTRL_ENCODE(100, 0, 11, 0), *handle);
  97.  
  98.     wptr = work_out;
  99.     end = wptr + 45;
  100.     iptr = _intout;
  101.     do {
  102.     *wptr++ = *iptr++;
  103.     } while (wptr < end);
  104.     end += 12;
  105.     iptr = _ptsout;
  106.     do {
  107.     *wptr++ = *iptr++;
  108.     } while (wptr < end);
  109. #else
  110.     _vdiparams[1] = &work_in[0];
  111.     _vdiparams[3] = &work_out[0];
  112.     _vdiparams[4] = &work_out[45];
  113.     __vdi__(VDI_CONTRL_ENCODE(100, 0, 11, 0), *handle);
  114.     _vdiparams[1] = (void *)&_intin[0];
  115.     _vdiparams[3] = (void *)&_intout[0];
  116.     _vdiparams[4] = (void *)&_ptsout[0];
  117. #endif
  118.     *handle = _contrl[6];
  119. }
  120. #endif /* L_v_opnvwk */
  121.  
  122. #ifdef L_v_clsvwk
  123.  
  124. /* close virtual workstation
  125.  *    returns void
  126.  */
  127. void v_clsvwk(int handle)
  128. {
  129.     __vdi__(VDI_CONTRL_ENCODE(101, 0, 0, 0), handle);
  130. }
  131. #endif /* L_v_clsvwk */
  132.  
  133. /* -eof- */
  134.